package org.jupiter.blog.api.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.jupiter.blog.api.annotation.NotEqualFields;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 系统权限 DTO
 */
//@NotEqualFields(sourceField = "uuid", targetField = "parentUuid", message = "父级权限不能和自身相同")
@EqualsAndHashCode(callSuper = true)
@Data
public class JupiterPermissionDTO extends PageRequestDTO {

	private String uuid;

	private String parentUuid;

	@NotBlank(message = "权限名称不能为空")
	@Size(max = 128, message = "权限名称长度不能超过128")
	private String name;

	@NotBlank(message = "权限编码不能为空")
	@Size(max = 128, message = "权限编码长度不能超过128")
	private String code;

	@Size(max = 255, message = "图标长度不能超过255")
	private String icon;

	@NotBlank(message = "权限类型不能为空")
	@Size(max = 20, message = "权限类型长度不能超过20")
	private String type;

	@Size(max = 255, message = "权限描述长度不能超过255")
	private String description;

	private Integer sortIndex;

	private LocalDateTime createTime;

	private LocalDateTime updateTime;

	private LocalDateTime deleteTime;

	/** 关联的URL资源UUID列表 */
	private List<String> urlResourceUuids;
}
